﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;


namespace Genesi
{
    public partial class MasterPages_Main : System.Web.UI.MasterPage
    {
        protected menuItem MenuSelectedItem;

        public menuItem selectedMenu
        {
            get
            {
                return MenuSelectedItem;
            }
            set
            {
                MenuSelectedItem = value;
                SelectMenu();
            }
        }

        protected override void OnPreRender(EventArgs e)
        {

            // this.SelectMenu();
            //   this.lnkHelp.InnerText = DDTKWebUIResources.Portal_Help;

            addStyle("../Styles/BasicStyles.css");
            addStyle("../Styles/ControlStyles.css");
            addStyle("../Styles/subModal.css");            
            addStyle("../css/jquery.noty.css");
            addStyle("../css/noty_theme_default.css");

            this.ScriptManager1.AsyncPostBackTimeout = 0;
            this.Page.ClientScript.GetPostBackEventReference(this, string.Empty);


            base.OnPreRender(e);
        }

        private void addStyle(string path)
        {
            HtmlLink htmlLink = new HtmlLink();
            htmlLink.Href = path;
            htmlLink.Attributes["rel"] = "stylesheet";
            htmlLink.Attributes["type"] = "text/css";
            htmlLink.Attributes["media"] = "all";
            this.Page.Header.Controls.Add(htmlLink);

        }


        public void SelectMenu()
        {
            switch (MenuSelectedItem)
            {
                case menuItem.models:
                    {
                        this.liModels.Attributes.Add("class", "selected");
                        break;
                    }
                case menuItem.orders:
                    {
                        this.lnkOrders.Attributes.Add("class", "selected");
                        break;
                    }
                case menuItem.ddt:
                    {
                        this.lnkDdt.Attributes.Add("class", "selected");
                        break;
                    }
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }





    }
}
